<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="initial-scale=1, width=device-width" />
        
        <script type="text/javascript" src="cordova.js"></script>
        <title></title>
        <script src="js/jquery-2.1.0.min.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
        
        <link rel="stylesheet" type="text/css" href="css/index.css" />
    </head>
    <body>
      <h1>phonegap-http-request</h1>
      <ul>
        <li>
          <h2>Create an instance</h2>
          <code>var httpReq = new plugin.HttpRequest();</code>
          <button id="initBtn">execude</button>
        </li>
        
        <li>
          <h2>get()</h2>
          <code>httpReq.get("http://www.w3schools.com/jquery/demo_test.asp", function(status, data) {
              alert(data);
            });
          </code>
          <button id="httpReq_get">execute</button>
        </li>
        
        <li>
          <h2>post()</h2>
          <code>httpReq.post("http://www.w3schools.com/php/welcome.php", {
              name: $("input[name='name']").val(),
              email: $("input[name='email']").val()
            },function(err, data) {
              alert(data);
            });
          </code>
          Name: <Input type="text" name="name" value="Mickey"><br>
          E-mail: <input type="text" name="email" value="mickey@hogehoge.com"><br>
          <button id="httpReq_post">execute</button>
        </li>
        
        
        <li>
          <h2>getJSON()</h2>
          <code>httpReq.getJSON("http://www.w3schools.com/jquery/demo_ajax_json.js", function(status, data) {
              alert(JSON.stringify(data));
            });
          </code>
          <button id="httpReq_getJSON">execute</button>
        </li>
      </ul>
    </body>
</html>
